package com.chao.demo.test;

class Student extends Person {
    public static String chao = "这个自私的家伙";
    private String name;

    public Student(String name, String name1) {
        super(name);
        this.name = name1;
        System.out.println("调用构造器Student");
    }

    public void getInfo() {
        System.out.println(this.name); //Child
        System.out.println(super.name); //Father
    }

    public static void main(String[] args) {
        Student s1 = new Student("Father", "Child");
        s1.getInfo();
    }
}

class Person {
    protected String name;

    public Person(String name) {
        this.name = name;
        System.out.println("调用构造器Person");
    }
}
